<div class="divColorbox">
    <div class="divColorbox_Header">
        <span><i class="fa fa-star"></i><span>冻结/解冻房间</span></span>
        <a class="Refresh"></a><a class="Close"></a>
    </div>
    <div class="divColorbox_Body row">
        <div>
            <input name="User_ID" type="hidden"/>
            <div class="row">
                <div class="col-sm-4">
                    <div class="input-group">
                        <span class="input-group-addon">房间ID/用户ID</span>
                        <input id="User_ID" type="text" class="form-control" value="-------------" disabled/>
                    </div>
                </div>
                <div class="col-sm-4">
                    <div class="input-group">
                        <span class="input-group-addon">艺人类型</span>
                        <input id="Tags" type="text" class="form-control" disabled/>
                    </div>
                </div>
                <div class="col-sm-4">
                    <div class="input-group">
                        <span class="input-group-addon">直播状态</span>
                        <input id="Live" type="text" class="form-control" disabled/>
                    </div>
                </div>
            </div>
            <div class="space-6"></div>
            <div class="row">
                <div class="col-sm-4">
                    <div class="input-group">
                        <span class="input-group-addon">开播时间</span>
                        <input id="Live_StartTime" type="text" class="form-control" disabled/>
                    </div>
                </div>
                <div class="col-sm-4">
                    <div class="input-group">
                        <span class="input-group-addon">直播间状态</span>
                        <input id="Anchor_Status" type="text" class="form-control" disabled/>
                    </div>
                </div>
            </div>
            <div class="space-6"></div>
            <div class="row">
                <div class="col-sm-4">
                    <div class="input-group">
                        <span class="input-group-addon">冻结/解冻描述</span>
                        <input id="Description" type="text" class="form-control"/>
                    </div>
                </div>
            </div>
        </div>
        <div class="divColorbox_Footer">
            <button type="button" id="btnFreeze_Melt" class="btn btn-primary">
                <i class="fa fa-check"></i> <span id="J_Freeze_En"></span>
            </button>
            <button type="button" id="btnUndo"></button>
        </div>
    </div>
    <script>
        $(function () {
            if (_PageData.flag != 0) {
                $.KOC.Tips.Open("Error", _PageData.flag, {
                    Timeout: 1000,
                    onClose: function () {
                        parent.$.colorbox.close();
                    }
                });
                return;
            }
            //////////////////////////////////////////////////////////
            //通过申请
            //////////////////////////////////////////////////////////
            $('#btnFreeze_Melt').on('click', function () {
                var params = {};
                params.User_ID = $.trim($('#User_ID').val());
                params.Anchor_Status = $.trim($('#Anchor_Status').val());
                params.Description = $.trim($('#Description').val());
                if (params.Anchor_Status == '冻结') {
                    params.Status = 0;
                } else {
                    params.Status = 1;
                }
                if (!params.User_ID) {
                    $.KOC.Tips.Open('Error', '数据出错请刷新', {Timeout: 2000});
                    return false;
                }
                if (!params.Description) {
                    $.KOC.Tips.Open('Error', '请输入冻结/解冻描述', {Timeout: 2000});
                    return false;
                }
                $.KOC.Loading.Open();
                $.ajax({
                    url: '/ajax/user.room-info.roomblock',
                    type: 'post',
                    dataType: 'json',
                    data: {
                        User_ID: params.User_ID,
                        Data: params.Description,
                        Status: params.Status
                    },
                    success: function (data) {
                        $.KOC.Loading.Close();
                        if (data.flag !== 0) {
                            $.KOC.Tips.Open("Error", data.msg + "(" + data.flag + ")", {Timeout: 2000});
                            return;
                        }
                        $.KOC.Tips.Open('Success', '修改完成', {
                            Timeout: 1000,
                            onClose: function () {
                                parent.$.colorbox.close();
                                parent.window.location.href = "/room-manage/info-manage/roomlist";
                            }
                        });
                    }
                });
            });
            //////////////////////////////////////////////////////////
            //数据绑定
            //////////////////////////////////////////////////////////
            $('#User_ID').val(_PageData.User_ID);
            $('#NickName').val(_PageData.NickName);
            $('#Tags').val(_PageData.Tags);
            $('#Live_StartTime').val(_PageData.Live_StartTime);
//        $('#Status').val(_PageData.Status);
            switch (_PageData.Live) {
                case 0 :
                    $("#Live").val('休息中');

                    break;
                case 1 :
                    $("#Live").val('直播中');
                    break;
                default:
                    $('#Live').val('');
                    break;
            }
            switch (_PageData.Anchor_Status) {
                case 0 :
                    $("#Anchor_Status").val('正常');
                    $('#J_Freeze_En').text('冻结');
                    break;
                case 1 :
                    $("#Anchor_Status").val('冻结');
                    $('#J_Freeze_En').text('解冻');
                    break;
                default:
                    $('#Anchor_Status').val('_');
                    break;
            }
        });
    </script>